/**
 * Created by sergey.garnov on 01.10.14.
 */

module.exports = function (app) {

    app.get('/', function (req, res) {
        res.render('index', {
            user: req.user,
            id: "home"
        });
    });

    app.get('/profile', function (req, res) {
        if (req.isAuthenticated()) {
            res.render('profile', {
                user: req.user,
                id: "profile"
            });
        }
        else
            res.redirect("/");


    });

    app.get('/about', function (req, res) {
        res.render('about', {
            user: req.user,
            id: "about"
        });
    });

    app.get('/contacts', function (req, res) {
        res.render('contacts', {
            user: req.user,
            id: "contacts"
        });
    });

    app.get('/search', function (req, res) {
        res.render('search', {
            user: req.user,
            id: "search"
        });
    });
}